from fastapi import HTTPException
from starlette.authentication import AuthenticationError
from starlette.status import *


HTTP_461_TOKEN_EXPIRED = 461


class AuthenticationError(AuthenticationError):
    def __init__(self, msg: str) -> None:
        self.msg = msg
        self.status_code = HTTP_401_UNAUTHORIZED


class AuthenticationExpired(AuthenticationError):
    def __init__(self, msg: str) -> None:
        self.msg = msg
        self.status_code = HTTP_461_TOKEN_EXPIRED
